<?php
// +----------------------------------------------------------------------
// author laobai
// +----------------------------------------------------------------------
// | Copyright (c) 2021 http://bbcweb.cn All rights reserved.
// +----------------------------------------------------------------------
namespace app\paiban\controller;

use think\admin\Controller;
use think\facade\Db;
use think\facade\Session;

class Common extends Controller
{
    protected $user;
    public function __construct() {
        
        $this->CommonInit();
    }
    protected function IsLogin()
	{
		if(empty($this->user))
		{
		    $this->redirect('/paiban/index/login');
		    die;
			//exit(json_encode(DataReturn('登录失效，请重新登录', -400)));
		}
    }
    private function CommonInit()
	{
		// 用户数据
		$this->user = Session::get("user");
	}
    protected function _empty($name)
	{
		exit(json_encode(DataReturn($name.' 非法访问', -1000)));
	}
}